Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
14 lines (9 loc) · 434 Bytes

2.2.4 - Server::$worker_id.md

File metadata and controls

14 lines (9 loc) · 434 Bytes

Server::$worker_id

得到当前Worker进程的编号,包括Task进程。

int $server->worker_id;

这个属性与onWorkerStart时的$worker_id是相同的。

  • Worker进程编号范围是[0, $serv->setting['worker_num']]
  • Task进程编号范围是[$serv->setting['worker_num'], $serv->setting['worker_num'] + $serv->setting['task_worker_num']]

工作进程重启后worker_id的值是不变的